//
//  ViewController.h
//  外星球生活圈
//
//  Created by MR.ZHOU on 15/8/12.
//  Copyright (c) 2015年 MR.ZHOU. All rights reserved.
//
#import "ZFBaseViewController.h"
#import "UIView+Toast.h"
#import "MBProgressHUD.h"
@interface ZFBaseViewController ()

@property(nonatomic,strong)MBProgressHUD *HUD;
@end

@implementation ZFBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor colorWithRed:rand()%255/255.0 green:rand()%255/255.0 blue:rand()%255/255.0 alpha:1.0];
    
    
}

- (void)showLoadingView{
    
    _HUD = [[MBProgressHUD alloc]initWithView:self.view];
    
    [_HUD show:YES];
    
    [self.view addSubview:_HUD];
}

- (void)hidenLoadingView{
    
    if (_HUD != nil) {
        [_HUD hide:YES];
        
        [_HUD removeFromSuperViewOnHide];
        
        _HUD = nil;
    }
    
}

- (void)showErrorMessage:(NSString *)message{
    [self.view makeToast:message];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
